# metaprogramming to the rescue!

class Numeric
  @@currencies = {'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019, 'dollar'=> 1}
  def method_missing(method_id, *arguments, &block)
    singular_currency = method_id.to_s.gsub( /s$/, '')
    if @@currencies.has_key?(singular_currency)
      self * @@currencies[singular_currency]
    elsif method_id.to_s == 'in'
	curr = arguments.first.to_s.gsub( /s$/, '')
	if @@currencies.has_key?(curr)
	 self / @@currencies[curr]
	else
      self # maybe need correction
    end
	else
      super
    end
  end
end

class String
  def palindrome?
	s = self.downcase.gsub(/\W/, "")
	s == s.reverse
  end
end

module Enumerable
  def palindrome?
	s = self.to_a
	s == s.reverse
  end
end